package com.coincalf.wallet.mapper;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.coincalf.wallet.entity.CoinRecharge;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户充值,当前用户充值成功之后添加数据到这个表,充值一般无手续费.当status为1的时候表示充值成功 Mapper 接口
 * </p>
 *
 * @author crow
 * @since 2018-05-16
 */
public interface CoinRechargeMapper extends BaseMapper<CoinRecharge> {


    List<CoinRecharge> selectRecharges(Pagination pagination,
                                       @Param("agencyUserId") long agencyUserId,
                                       @Param("userName") String userName,
                                       @Param("orderId") long orderId,
                                       @Param("status") Integer status,
                                       @Param("coinId") long coinId,
                                       @Param("parentId") long parentId,
                                       @Param("createTime") String createTime);


    Map<String, Object> selectRechargesTotal(@Param("agencyUserId") long agencyUserId);

    /**
     * 修改充值记录状态
     *
     * @param id
     * @param status
     * @return
     */
    int modifyRechargeStatus(@Param("id") Long id, @Param("status") Integer status, @Param("collected") Integer collected);

    int updateTxStatus(@Param("id") Long id, @Param("status") Integer status);
}
